1. Field of the Invention
The invention relates to a data compression method and, more particularly, to a print data compressing method suitable for a printer.
2. Description of Related Art
Typical In-Line technologies firstly process print data through a host and then the host sends the processed data to a printer for printing, which only performs motor movement and ink spraying operations at this point. However, the amount of print data increases more and more as increasing print resolution. For example, for a 600 dpi (dot per inch) resolution, required data amount for printing on an A4 paper is 600 (dpi)×8 (inch)×600 (dpi)×11 (inch)/8=3.96 Mbytes. Accordingly, print data must be compressed and subsequently sent to the printer, thereby reducing data transmission amount between the host and the printer. A conventional method applies PCL algorithm to an image file to be printed for first compression and then transmission to a printer to interpret and final print. However, such a method requires more complicated hardware to interpret the PLC data.
To overcome this, U.S. Pat. No. 5,930,466 uses the features of an image file to be printed to compress the transmitting image file. This is achieved by defining a compressed unit as required print data by all nozzles on a printhead. For example, there are 192 nozzles on the printhead and accordingly required print data is 192 bits, which form a slice, or 192/8=24 segments.
Each slice can be compressed by two ways. First way is shown in FIG. 1, which uses a feature of no ink ejection on blank regions in a picture frame to thus achieve data compression purpose. In this case, a segment of data with “0” is deleted and represented by a 1-bit status flag. Namely, when the 1-bit status flag is “1”, it indicates a corresponding segment of data with “0”; conversely, when the 1-bit flag is “0”, it indicates that a corresponding segment of data is not compressed. In FIG. 1, after an uncompressed data such as {10111111, 00000000, 00000000, 11100111, . . . } is compressed, corresponding second and third bits of the status flag are “1” respectively to indicate the second and the third segments of data with “0”, thereby reducing data amount. An optimal situation is that a 24-byte data can be recorded by only 24 bits for a slice of data with 0. However, such a way can obtain effective compression only for a segment of data with “00000000”.
Second way is shown in FIG. 2, wherein when a segment of data is not recorded when it has the same data as a previous segment of data. Namely, if the status flag is “1”, it indicates that the corresponding segment has the same data as a previous segment and, conversely, it indicates that the corresponding segment of data is not compressed. In FIG. 2, for an uncompressed data such as {10101010, 10101010, 10101010, 11100111, . . . }, the first to third segments have the same data so that after compressed, corresponding second and third bits of the status flag are “1” to indicate the second and the third segments having the same data as the first segment. Thus, the data transmission amount is decreased. Likely, an optimal situation is that all segments of a slice have the same data so that a 24-byte data can be recorded by only 4 bytes (24bits+1byte). However, such a way can obtain effective compression only for a slice with a single data pattern. For a slice with two or more data patterns, only one of the data patterns can be compressed and the other cannot. Therefore, such a way cannot have satisfactory compression efficiency even through it can overcome the cited complicated hardware.
Therefore, it is desirable to provide an improved method to mitigate and/or obviate the aforementioned problems.